package com.limingfeiyu.platform.management.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.limingfeiyu.common.web.PageTable;
import com.limingfeiyu.platform.management.entity.SysUser;
import com.limingfeiyu.platform.management.mapper.SysUserMapper;
import com.limingfeiyu.platform.management.service.ISysUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

/**
 * <p>
 * 用户信息表 服务实现类
 * </p>
 *
 * @author 黎铭飞羽
 * @since 2024-03-01
 */
@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService {

    @Override
    public Page<SysUser> pageList(PageTable<SysUser> pageTable) {
        QueryWrapper<SysUser> userQw = new QueryWrapper<>();
        if (pageTable.getParam() != null) {
            userQw.lambda()
                    // 用户名称
                    .like(!StringUtils.hasText(pageTable.getParam().getUserName()),
                            SysUser::getUserName, pageTable.getParam().getUserName())
            ;
        }
        Page<SysUser> page = super.page(pageTable.getPage(), userQw);
        return page;
    }




}
